<!DOCTYPE html>
<html>
<head>
    <title>箱子管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="/css/bootstrap-responsive.css" rel="stylesheet" media="screen">
    <link rel="stylesheet" type="text/css" href="/css/style.css">
    <script src="/lib/jq/jquery-2.1.1.min.js"></script>
    <script src="/lib/jq/bootstrap.min.js"></script>
</head>
<body style="margin:15px;">
    <legend>箱子状态</legend>
    <div style="margin-left: 64%">
        <a href="/box_management/doors?doorsnum=<%=doordatas.length%>&boxid=<%=boxid%>&index=all">
            <button style="width:80px;height:30px;background-color:#DBDBDB;border:1px solid #DBDBDB;border-radius:3px;">全部打开</button>
        </a>
    </div>
    <div style="margin-left: 25%">
        <table class="table table-bordered" style="margin:20px;width: 60%">
            <tr>
                <td style="text-align: center">门号</td>
                <td style="text-align: center">状态</td>
                <td style="text-align: center">操作</td>
            </tr>
            <% doordatas.forEach(function(door){ %>
            <tr>
                <td style="width: 10%;"><label style="text-align: center"><%=door.index %></label></td>
                <% if(door.empty){ %>
                <td style="background-color: #33CC8F;width: 30%">
                    <div class="gridrow-status" style="text-align: center" >空闲</div>
                </td>
                <td style="width: 10%;text-align: center">
                    <span style="color: #B3B3B3">打开</span>
                </td>
                    <% }else{ %>
                <td style="background-color:#FF2D2D;width: 30%">
                    <div class="gridrow-status" style="text-align: center;" >占用</div>
                </td>
                <td style="width: 10%;text-align: center">
                    <a href="/box_management/doors?index=<%=door.index%>&boxid=<%=boxid%>">打开</a>
                </td>
                <% } %>
            </tr>
            <%});%>
        </table>
    </div>
</body>
</html>